package com.cskaoyan.controller;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

/**
 * 请求头限定
 * @author stone
 * @date 2021/12/30 15:55
 */
@Controller
@RequestMapping("header")
public class HeaderController {

    //多个值之间的关系是and，全都要
    @RequestMapping(value = "limit",headers = {"aaa","bbb"})
    @ResponseBody
    public String headerLimit() {
        return "header limit";
    }

    @RequestMapping(value = "consumes", consumes = "aaa/bbb")
    @ResponseBody
    public String contentTypeLimit() {
        return "ContentType limit";
    }

    @RequestMapping(value = "produces", produces = "ccc/ddd")
    @ResponseBody
    public String acceptLimit() {
        return "Accept limit";
    }
}
